"""

"""

import multiprocessing
import os
import time


def test():
    time.sleep(5)
    print("Process ID: ", os.getpid())
    print("Parent Process ID: ", os.getppid())


if __name__ == "__main__":
    print('主进程开始......')

    p_list = []
    for i in range(5):
        p = multiprocessing.Process(target=test)
        p.start()
        p_list.append(p)

    # p_list 每个元素都是一个进程对象
    for p in p_list:
        p.join()

    print('主进程结束......')
